home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / apb17.zip / ABSOLUTE.ASM next >
Assembly Source File  |  1990-12-20  |  720b  |  30 lines

  1.     Title Subprogram to call any absolute location in memory
  2.     Page 60,130
  3. ;    Created 10-17-1987 k. murray
  4. ;
  5. Cseg    Segment byte public 'Code'
  6.     Assume Cs:Cseg,Ds:nothing,Es:nothing
  7. ;
  8. ;    Define in program:
  9. ;        Sub Absolute Offset% External "absolute.com"
  10. ;    Call in program:
  11. ;        Absolute Adr%
  12. ;
  13. ;    Stack frame:
  14. ;    Sp+4    Adr. of offset
  15. ;    Sp+2    Return Segment
  16. ;    Sp+0    Return Offset
  17. Start:
  18. Absolute Proc Far
  19.     Pop    Ax        ; Get return offset
  20.     Pop    Dx        ; Get return segment
  21.     Pop    Bx        ; Address of offset%
  22.     Push    Dx
  23.     Push    Ax        ; put return adr. back
  24.     Push    Ds:[4]        ; Push current Def Seg segment
  25.     Push    [Bx]        ; Push Offset% value
  26.     Ret            ; This will now do a far return to memory location
  27. Absolute Endp
  28. Cseg    Ends
  29.     End    Start
  30.